<?php
class Order extends EMongoDocument // Notice: We extend EMongoDocument class instead of CActiveRecord
{
    //订单号
    public $number;
    //收货人
    public $consignee;
    //手机
    public $mobile;
    //固定电话
    public $telephone;

    public $email;
    //地址
    public $address;
    //卖家
    public $sales;
    //商品
    public $goods;
    //价格
    public $price;
    //配送方式
    public $distribution;
    //运费
    public $freight;
    //留言
    public $message;
    //状态
    public $status;
    //买家
    public $userid;

    public $auction;

    public $paidprice;

    public $createtime;

    public $updatetime;

    /**
     * This method have to be defined in every Model
     * @return string MongoDB collection name, witch will be used to store documents of this model
     */
    public function getCollectionName()
    {
        return 'order';
    }
 
    // We can define rules for fields, just like in normal CModel/CActiveRecord classes
    public function rules()
    {
        return array(
        
        );
    }

// the same with attribute names
public function attributeNames()
{
    return array(
        //'ad' => 'ad',
        'number'=>'number',
        'consignee'=>'consignee',
        'mobile'=>'mobile',
        'telephone'=>'telephone',
        'address'=>'address',
        'sales'=>'sales',
        'goods'=>'goods',
        'price'=>'price',
        'distribution'=>'distribution',
        'freight'=>'freight',
        'message'=>'message',
        'status'=>'status',
        'userid'=>'userid',
        'email'=>'email',
         '_id'=>'_id',
         'auction'=>'auction',
        'paidprice'=>'paidprice',
        'updatetime'=>'updatetime',
        'createtime'=>'createtime'
       );
    }


    /**
     * This method have to be defined in every model, like with normal CActiveRecord
     */
    public static function model($className=__CLASS__)
    {
        return parent::model($className);
    }
}